#version 460
#define GLSLIFY 1

#define GLSLIFY 1
#define PROJECT_MATRIX

/*
0 投影矩阵
1 属性参数
2 变换数据
3 颜色数据

4 顶点数据
5 顶点配置参数


6 颜色控制参数

10 纹理数据

*/

layout(std140, set=0, binding=0) uniform U_Matrix {
	mat4 mat_ProjecView[2];
};

layout(std140, binding = 1) readonly buffer U1_Matrix {
	mat4 mat_Model[];
};

layout(std140, binding = 2) readonly buffer U2_Matrix {
	mat4 mat_Normal_Index[];
};
layout(std140, binding = 3) readonly buffer U3_Matrix {
	mat4 mat_UV_Index[];
};

layout(std140, binding = 4) readonly buffer U4_Matrix {
	vec2 mat_UV[];
};

layout(location = 0) in vec3 inVertex;
layout(location = 1) in vec3 inNormal;
//layout(location = 2) in vec3 inUV;

layout(location = 0) out VS_GS_VERTEX {
    mat4    v_ViewMaterix;
    mat4    v_ModelMaterix;
	uint	v_InstanceIndex;
}vertex_in;

void main(void) {
    v_ViewMaterix = mat_ProjecView;
    v_ModelMaterix = mat_Model[gl_InstanceIndex];
	//gl_Position = mat_ProjecView * mat_Model[gl_InstanceIndex] * vec4(inPos.xyz, 1.0);
	gl_Position = vec4(inPos.xyz, 1.0);
	gl_PointSize = inPos.w;

	//vertex_in.v_VType = vertex_type.w;
	vertex_in.v_InstanceIndex = gl_InstanceIndex;

}

